package io.xxx.mario.room;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.xxx.mario.robot.Robot;
import io.xxx.mario.task.ReceiverType;
import io.xxx.mario.task.receive.Receiver;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Room implements Receiver {

    @TableId
    private Long id;

    @ExcelProperty("群ID")
    private String outId;

    private String name;

    private Integer memberCount;

    private Long robotId;

    private String robotWxId;

    private String robotNickName;

    private String inviterOutId;

    private String inviterNickName;

    private boolean inRoom;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime joinedTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedTime;

    @TableField(exist = false)
    private Robot robot;

    @Override
    public Long id() {
        return id;
    }

    @Override
    public String outId() {
        return outId;
    }

    @Override
    public Long robotId() {
        return robotId;
    }

    @Override
    public String robotWxId() {
        return robotWxId;
    }

    @Override
    public String robotNickName() {
        return robotNickName;
    }

    @Override
    public String name() {
        return name;
    }

    @Override
    public ReceiverType type() {
        return ReceiverType.ROOM;
    }
}
